/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.controller;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import org.apache.log4j.Logger;
import queenb.net.entitybean.K950V;
import queenb.net.entitybean.N950;
import queenb.net.entitybean.PageContact;
import queenb.web.crm.store.K950Store;
import queenb.web.inteface.ContactInf;
import queenb.web.store.ContactStore;
import queenb.web.util.ContextUtil;
import queenb.web.util.SessionProvider;
import queenb.web.util.Util;

/**
 *
 * @author thanh luan
 */
public class N950Controller extends QueenbController {

    private static Logger logger = Logger.getLogger(N950Controller.class);
    private boolean flag = false;
    private int fn100;//id n100
    private int pn950;//id n950
    private String nv967;//tel
    private String nv968;//sky
    private String nv969;//yahoo
    private String nv952 ="contact";//diachi
    private String nv955;//Quan/Huyen
    private String nv957;//tinh thanh
    private String nv954;// address 2
    private String nv958;//tel 1
    private String nv959;//tel 2
    private String nv960;//tel 3
    private String nv961;//mobi 1;
    private String nv962;//mobi 2
    private String nv963;//mobi 3
    private String nv964;//fax 1
    private String nv965;//fax 2
    private String nv966;//fax 3
     private String nv974;//fax 3
      private String nv975;//fax 3
    private int FN750;
    private ContactInf contactInf;
    private ContactStore contactStore;
    private List<N950> listFindN950 = null;
    private List<N950> listFind_N950 = new ArrayList<N950>();
    private List<SelectItem> listCountry;
    private String temp = "";
    private String temp_active = "display:none;";
    private boolean flagedit;
    private String pagereload;
    private String table = "N100";
    private String table1 = "abc";
    private boolean add = false;
    private boolean edit = false;
    private boolean delete = false;
    private String messageform = "";
    private List<N950> listAjaxN950Bean;
    private List<K950V> listAjaxK950VBean;
    private int render;
    private int beginContructor;
    private List<PageContact> listpage = new ArrayList<PageContact>();
    private int pc = 0;

    
    // TUNG TRIEN KHAI LAI KAPI
    
    private List<N950> listoftabN950 = new ArrayList<N950>();
    public N950Controller() {
        contactStore = new ContactStore();
        Object objAction = getRequest().getParameter("action");
        if (objAction != null) {
            if (objAction.equals("saveN950")) {
                // this.fn100 = EmployeeController.idEmp;
                System.out.println("--pn100-----------------" + this.fn100);
            }
        }

        Object objPN100 = getRequest().getParameter("pn100");
        if (objPN100 != null) {
            this.fn100 = Integer.parseInt(objPN100.toString());
        }
        // Khong dung chung duoc cac bien

        Object pn100N = getRequest().getParameter("id");

        if (pn100N != null) {
            this.fn100 = Integer.parseInt(pn100N.toString());
        }
        try {
            this.pagereload = getRequest().getParameter("page");
            if (this.pagereload == null) {
                this.pagereload = ContextUtil.getRequestParameter("page");

            }
            //this.pagereload = pages.toString();
            System.out.println("**************************" + pagereload);
//            if (pagereload.equals("employee.jsp")) {
//                if (getLoginSession().getRight().isEMP_CON_CRE()) {
//                    add = true;
//                    System.out.println("*************employee2*************" + pagereload);
//                }
//                if (getLoginSession().getRight().isEMP_CON__MOD()) {
//                    edit = true;
//                }
//                if (getLoginSession().getRight().isEMP_CON_DEL()) {
//                    delete = true;
//                }
//            }
//            if (pagereload.equals("employeenew.jsp")) {
//                if (getLoginSession().getRight().isEMP_CON_CRE()) {
//                    add = true;
//                    System.out.println("*************employee2*************" + pagereload);
//                }
//                if (getLoginSession().getRight().isEMP_CON__MOD()) {
//                    edit = true;
//                }
//                if (getLoginSession().getRight().isEMP_CON_DEL()) {
//                    delete = true;
//                }
//            }
//            if (pagereload.equals("customer.jsp")) {
//                if (getLoginSession().getRight().isCUS_CON_CRE()) {
//                    add = true;
//                }
//                if (getLoginSession().getRight().isCUS_CON_MOD()) {
//                    edit = true;
//                }
//                if (getLoginSession().getRight().isCUS_CON_DEL()) {
//                    delete = true;
//                }
//            }
//            if (pagereload.equals("cuscompany.jsp")) {
//                if (getLoginSession().getRight().isCOM_CON_CRE()) {
//                    add = true;
//                }
//                if (getLoginSession().getRight().isCOM_CON_MOD()) {
//                    edit = true;
//                }
//                if (getLoginSession().getRight().isCOM_CON_DEL()) {
//                    delete = true;
//                }
//            }
//            if (pagereload.equals("supplier.jsp")) {
//                if (getLoginSession().getRight().isSUP_CON_CRE()) {
//                    add = true;
//                }
//                if (getLoginSession().getRight().isSUP_CON_MOD()) {
//                    edit = true;
//                }
//                if (getLoginSession().getRight().isSUP_CON_DEL()) {
//                    delete = true;
//                }
//            }
//            if (pagereload.equals("partner.jsp")) {
//                if (getLoginSession().getRight().isSUP_CON_CRE()) {
//                    add = true;
//                }
//                if (getLoginSession().getRight().isSUP_CON_MOD()) {
//                    edit = true;
//                }
//                if (getLoginSession().getRight().isSUP_CON_DEL()) {
//                    delete = true;
//                }
//            }
        } catch (Exception ex) {
            System.out.println("----ex-------" + ex.getMessage());
        }
        Object fn100M = ContextUtil.getRequestParameter("fn100M");
        Object fn100A = ContextUtil.getRequestParameter("fn100A");
        Object fn100E = ContextUtil.getRequestParameter(("fn100E"));
        Object pn950E = ContextUtil.getRequestParameter("pn950E");
        Object pntable = ContextUtil.getRequestParameter("table");
        Object pntable1 = ContextUtil.getRequestParameter("table1");
        if (pntable != null) {
            table = pntable.toString();
            this.table1 = pntable.toString();
        }
        if (objAction != null) {

            if (objAction.equals("add")) {
                this.fn100 = Integer.parseInt(fn100A.toString());
                if (pntable1 != null) {
                    this.table1 = pntable1.toString();
                }
                 Object objPage = ContextUtil.getRequestParameter("page");
                  if (objPage != null) {
                    pagereload = objPage.toString();
                }
                  System.out.println("-----------------------PAGE-------------"+pagereload);
                this.pn950 = 0;
                this.flagedit = true;
            } else if (objAction.equals("edit")) {
                this.fn100 = Integer.parseInt(fn100E.toString());
                Object objPage = ContextUtil.getRequestParameter("page");
                  if (objPage != null) {
                    pagereload = objPage.toString();
                }
                  System.out.println("-----------------------PAGE-------------"+pagereload);
                this.pn950 = Integer.parseInt(pn950E.toString());
                if (pntable1 != null) {
                    this.table1 = pntable1.toString();
                }
                this.flagedit = false;
            } else if (objAction.equals("editajaxpage")) {
                listpage = new ArrayList<PageContact>();
                List<N950> listNew = null;
                List<K950V> listNewK = null;
                System.out.println("-----du lieu contaat ---");
                if (listNew == null) {
                    System.out.println("----" + fn100 + "," + 0 + "," + getLogin().getUserName());
                    System.out.println("--table----" + table);
                    if (table.equals("K100")) {
                        K950Store k950Store = new K950Store();
                        listNewK = k950Store.getListTabK950(fn100, 0, getLogin().getUserName());
                    } else {
                        System.out.println("D:-- pc: " + pc);
                        listNew = contactStore.getListContactpt(fn100, pc, getLogin().getUserName());
                        if (listNew != null && listNew.size() > 0) {
                            N950 n9 = listNew.get(0);
                            int max = n9.getADRNO();
                            for (int i = 0; i < max; i++) {
                                PageContact p = new PageContact(n9.getADRID(), Integer.toString(i + 1), false, false);
                                listpage.add(p);
                            }

                        }
                    }
                    // listNew = getListPrepareUpdateN950(fn100, 0);
                }
                listAjaxN950Bean = new ArrayList<N950>();
                listAjaxK950VBean = new ArrayList<K950V>();
                if (listNew != null) {

                    listAjaxN950Bean = listNew;
                    if (listAjaxN950Bean.size() > 0) {
                        render = 1;
                    } else {
                        render = 0;
                    }
                    System.out.println("-----du lieu contaat 4444 ---" + listAjaxN950Bean.size());
                }
                if (listNewK != null) {

                    listAjaxK950VBean = listNewK;
                    if (listAjaxK950VBean.size() > 0) {
                        render = 1;
                    } else {
                        render = 0;
                    }
                    System.out.println("-----du lieu contaat 555 ---" + listAjaxK950VBean.size());
                }
            } else if (objAction.equals("updateN950Ajax")) {
                Object objnv952 = getRequest().getParameter("nv952");
                if (objnv952 != null) {
                    this.nv952 = objnv952.toString();
                }
                Object objnv954 = getRequest().getParameter("nv954");
                if (objnv954 != null) {
                    this.nv954 = objnv954.toString();
                }
                Object objnv955 = getRequest().getParameter("nv955");
                if (objnv955 != null) {
                    this.nv955 = objnv955.toString();
                }

                Object objnv967 = getRequest().getParameter("nv967");
                if (objnv967 != null) {
                    this.nv967 = objnv967.toString();
                }
                Object objnv957 = getRequest().getParameter("nv957");
                if (objnv957 != null) {
                    this.nv957 = objnv957.toString();
                }
                Object objnv958 = getRequest().getParameter("nv958");
                if (objnv958 != null) {
                    this.nv958 = objnv958.toString();
                }
                Object objnv959 = getRequest().getParameter("nv959");
                if (objnv959 != null && !objnv959.toString().equals("undefined")) {
                    this.nv959 = objnv959.toString();
                } else {
                    this.nv959 = "";
                }
                Object objnv960 = getRequest().getParameter("nv960");
                if (objnv960 != null && !objnv960.toString().equals("undefined")) {
                    this.nv960 = objnv960.toString();
                } else {
                    this.nv960 = "";
                }
                Object objnv961 = getRequest().getParameter("nv961");
                if (objnv961 != null) {
                    this.nv961 = objnv961.toString();
                }
                Object objnv962 = getRequest().getParameter("nv962");
                if (objnv962 != null && !objnv962.toString().equals("undefined")) {
                    this.nv962 = objnv962.toString();
                } else {
                    this.nv962 = "";
                }
                Object objnv963 = getRequest().getParameter("nv963");
                if (objnv963 != null && !objnv963.toString().equals("undefined")) {
                    this.nv963 = objnv963.toString();
                } else {
                    this.nv963 = "";
                }
                Object objnv964 = getRequest().getParameter("nv964");
                if (objnv964 != null) {
                    this.nv964 = objnv964.toString();
                }
                Object objnv965 = getRequest().getParameter("nv965");
                if (objnv965 != null && !objnv965.toString().equals("undefined")) {
                    this.nv965 = objnv965.toString();
                } else {
                    this.nv965 = "";
                }
                Object objnv966 = getRequest().getParameter("nv966");
                if (objnv966 != null && !objnv966.toString().equals("undefined")) {
                    this.nv966 = objnv966.toString();
                } else {
                    this.nv966 = null;
                }

                Object objnv968 = getRequest().getParameter("nv968");
                if (objnv968 != null) {
                    this.nv968 = objnv968.toString();
                }
                Object objnv969 = getRequest().getParameter("nv969");
                if (objnv969 != null) {
                    this.nv969 = objnv969.toString();
                }
                
                Object objnv974 = getRequest().getParameter("nv974");
                if (objnv974 != null) {
                    this.nv974 = objnv974.toString();
                }
                
                Object objnv975 = getRequest().getParameter("nv975");
                if (objnv975 != null) {
                    this.nv975 = objnv975.toString();
                }

                Object objpn950 = getRequest().getParameter("pn950");
                if (objpn950 != null) {
                    this.pn950 = Integer.parseInt(objpn950.toString());
                }
                Object objfn100 = getRequest().getParameter("fn100");
                if (objfn100 != null) {
                    this.fn100 = Integer.parseInt(objfn100.toString());
                }
                Object objtable = getRequest().getParameter("table");
                if (objtable != null) {
                    this.table = objtable.toString();
                }
                System.out.println("---table +" + table);

                saveN950();
            } else if (objAction.equals("repost")) {
                Object objfn100 = getRequest().getParameter("fn100");
                if (objfn100 != null) {
                    this.fn100 = Integer.parseInt(objfn100.toString());
                }
                Object objaddid = getRequest().getParameter("addid");
                System.out.println("D:-- addid: " + objaddid);
                if (objaddid != null) {
                    this.pc = Integer.parseInt(objaddid.toString());
                }
            }

        }

        if (fn100M != null && pn950E == null) {
            this.fn100 = Integer.parseInt(fn100M.toString());
            listFind_N950 = getListPrepareUpdateN950(fn100, 0);
            if (listFind_N950.size() > 0) {
                this.pn950 = listFind_N950.get(0).getADRNO();
            }
        }
        if (fn100M != null && pn950E != null) {
            this.fn100 = Integer.parseInt(fn100M.toString());
            this.pn950 = Integer.parseInt(pn950E.toString());
            this.table1 = pntable1.toString();
            listFind_N950 = getListPrepareUpdateN950(fn100, pn950);
        }

        if (pn100N != null) {
            this.fn100 = Integer.parseInt(pn100N.toString());
            listFind_N950 = getListPrepareUpdateN950(fn100, 0);
            if (listFind_N950.size() > 0) {
                this.fn100 = listFind_N950.get(0).getADRID();
            }
        } else {
            if (fn100 != 0 && pn950 != 0) {
                listFindN950 = getListPrepareUpdateN950(fn100, pn950);
            }
        }

        Object pn100A = getRequest().getParameter("pn100A");
        if (pn100A != null) {
            this.fn100 = Integer.parseInt(pn100A.toString());
            this.pn950 = Integer.parseInt(pn950E.toString());
            if (fn100 > 0) {
                Object contactoObject = getRequest().getParameter("action");
                if (contactoObject != null && contactoObject.equals("contact")) {
                    getListPrepareUpdateN950(fn100, pn950);
                }
            }


        }
    }

    public void saveN950() {
        try {

            int roweffect = 0;

            if (flagedit == true) {
                if (this.nv952 != "") {

                    roweffect = contactStore.updateN950By(this.fn100, pn950, getTable(), this.nv952,
                            null, this.nv954, this.nv955, null, this.nv957, 1, this.nv958, this.getNv959(), this.nv960, this.nv961,
                            this.nv962, this.getNv963(), this.getNv964(), this.getNv965(), this.getNv966(), this.nv967, this.getNv968(), this.nv969, null, null, 1,null,nv974,nv975, getLogin().getUserName());
                    if (roweffect > 0) {
                        setMessageform(getResourceString("success"));
                        // showGlobalReport(true, getResourceString("datasavesuccessful"));
                    } else {
                        setMessageform(getResourceString("error"));
                        // showGlobalReport(true, getResourceString("datasuccessfail"));
                    }
                } else {
                    setMessageform(getResourceString("error"));
                }

            } else {
                if (this.nv952 != "") {
                    System.out.println("-----id333-------------------------------" + this.fn100 + "," + pn950 + "," + getTable() + "," + this.nv952 + ","
                            + null + "," + this.nv954 + "," + this.nv955 + "," + null + "," + this.nv957 + "," + 1 + "," + this.nv958 + "," + this.getNv959() + "," + this.nv960 + "," + this.nv961 + ","
                            + this.nv962 + "," + this.getNv963() + "," + this.getNv964() + "," + this.getNv965() + "," + this.getNv966() + "," + this.nv967 + "," + this.getNv968() + "," + this.nv969 + "," + null + "," + null + "," + 1 + "," + getLogin().getUserName());
                    roweffect = contactStore.updateN950By(this.fn100, pn950, getTable(), this.nv952,
                            null, this.nv954, this.nv955, null, this.nv957, 1, this.nv958, this.getNv959(), this.nv960, this.nv961,
                            this.nv962, this.getNv963(), this.getNv964(), this.getNv965(), this.getNv966(), this.nv967, this.getNv968(), this.nv969, null, null, 1,null,nv974,nv975, getLogin().getUserName());
                    if (roweffect >= 0) {
                        setMessageform(getResourceString("success"));

                    } else {
                        setMessageform(getResourceString("error"));
                        // showGlobalReport(true, getResourceString("datasuccessfail"));
                    }
                } else {
                    setMessageform(getResourceString("error"));
                }


            }
            if (!table1.equals("")) {
                System.out.println("----------------" + table1);
                if (table1.equals("myprofile")) {
                    if (!this.nv952.equals("")) {
                        showGlobalReport(true, getResourceString("datasavesuccessful"));
                    } else {
                        showGlobalReport(true, getResourceString("datasuccessfail"));
                    }

                    sendRedirectUrlTab("myprofile.jsp?fn100M=" + fn100 + "&linkmyprofile=" + Util.convertMD5(getRequest().getRequestURI()));
                } else if (pagereload != null) {
                    if (!this.nv952.equals("")) {
                        showGlobalReport(true, getResourceString("datasavesuccessful"));
                    } else {
                        showGlobalReport(true, getResourceString("datasuccessfail"));
                    }
                    sendRedirectURL(pagereload, fn100, 1);
                }
            }
        } catch (Exception ex) {
            System.out.println("00000>>>>" + ex.getMessage());

            showGlobalReport(true, getResourceString("datasuccessfail"));
        }

    }
    // TUng lam moi thong tinlien lac
      public void saveN950new() {
        try {
            int roweffect = 0;
            if (flagedit == true) {
                if (this.nv952 != "") {
                    roweffect = contactStore.updateN950By(this.fn100, pn950, getTable(), this.nv952,
                            null, this.nv954, this.nv955, null, this.nv957, 1, this.nv958, this.getNv959(), this.nv960, this.nv961,
                            this.nv962, this.getNv963(), this.getNv964(), this.getNv965(), this.getNv966(), this.nv967, this.getNv968(), this.nv969, null, null, 1,null,nv974,nv975, getLogin().getUserName());
                    if (roweffect > 0) {
                        setMessageform(getResourceString("success"));
                    } else {
                        setMessageform(getResourceString("error"));
                    }
                } else {
                    setMessageform(getResourceString("error"));
                }
            } else {
                if (this.nv952 != "") {
                    System.out.println("-----id333-------------------------------" + this.fn100 + "," + pn950 + "," + getTable() + "," + this.nv952 + ","
                            + null + "," + this.nv954 + "," + this.nv955 + "," + null + "," + this.nv957 + "," + 1 + "," + this.nv958 + "," + this.getNv959() + "," + this.nv960 + "," + this.nv961 + ","
                            + this.nv962 + "," + this.getNv963() + "," + this.getNv964() + "," + this.getNv965() + "," + this.getNv966() + "," + this.nv967 + "," + this.getNv968() + "," + this.nv969 + "," + null + "," + null + "," + 1 + "," + getLogin().getUserName());
                    roweffect = contactStore.updateN950By(this.fn100, pn950, getTable(), this.nv952,
                            null, this.nv954, this.nv955, null, this.nv957, 1, this.nv958, this.getNv959(), this.nv960, this.nv961,
                            this.nv962, this.getNv963(), this.getNv964(), this.getNv965(), this.getNv966(), this.nv967, this.getNv968(), this.nv969, null, null, 1,null,nv974,nv975, getLogin().getUserName());
                    if (roweffect >= 0) {
                        setMessageform(getResourceString("success"));
                    } else {
                        setMessageform(getResourceString("error"));
                    }
                } else {
                    setMessageform(getResourceString("error"));
                }
            }
            if (!table1.equals("")) {
                System.out.println("----------------" + table1);
                if (table1.equals("myprofile")) {
                    if (!this.nv952.equals("")) {
                        showGlobalReport(true, getResourceString("datasavesuccessful"));
                    } else {
                        showGlobalReport(true, getResourceString("datasuccessfail"));
                    }

                    sendRedirectUrlTab("myprofile.jsp?fn100M=" + fn100 + "&linkmyprofile=" + Util.convertMD5(getRequest().getRequestURI()));
                } else if (pagereload != null) {
                    if (!this.nv952.equals("")) {
                        showGlobalReport(true, getResourceString("datasavesuccessful"));
                    } else {
                        showGlobalReport(true, getResourceString("datasuccessfail"));
                    }
                //    sendRedirectURL(pagereload, fn100, 1);
                    sendRedirectUrlTab(pagereload+"?tab=itemcontent"+fn100+"&linkEmp="+ Util.convertMD5(getRequest().getRequestURI()));
                }
            }
        } catch (Exception ex) {
            System.out.println("00000>>>>" + ex.getMessage());

            showGlobalReport(true, getResourceString("datasuccessfail"));
        }

    }
    private int fn100N;

    public List<N950> getListPrepareUpdateN950(int id, int pn) {
        try {
            //fn100 = EmployeeController.pnPN100Detail;

            if (table.equals("K100")) { // edit contact k100
                List<K950V> list = new ArrayList<K950V>();
                K950Store store = new K950Store();

                list = store.getListTabK950(id, pn, getLogin().getUserName());
                if (list.size() > 0) {
                    K950V n950 = list.get(0);
                    this.nv958 = n950.getTEL1();
                    this.nv959 = n950.getTEL2();
                    this.nv960 = n950.getTEL3();
                    this.nv961 = n950.getMOB1();//mobiphone;
                    this.nv962 = n950.getMOB2();
                    this.nv963 = n950.getMOB3();
                    this.nv964 = n950.getFAX1();
                    this.nv965 = n950.getFAX2();
                    this.nv966 = n950.getFAX3();
                    this.nv967 = n950.getEML1();//emai
                    this.nv968 = n950.getEML2();//sky
                    this.nv969 = n950.getEML3();//yahoo
//                    this.nv962 = n950.getMOB2();
                    this.nv952 = n950.getStr1();
                    this.nv955 = n950.getDIST();

                    this.nv957 = n950.getCITY();//tinh thanh
//                    this.nv960 = n950.getTEL3();//note
                    this.nv954 = n950.getWARD();
                    this.fn100 = n950.getADRID();
                    this.pn950 = n950.getADRNO();
                    this.fn100N = n950.getADRID();
                }
            } else { // edit contact N100
                listFindN950 = contactStore.getListContact(id, pn, getLogin().getUserName());
                if (listFindN950.size() > 0) {
                    Iterator ic = listFindN950.iterator();
                    while (ic.hasNext()) {
                        N950 n950 = (N950) ic.next();
                        this.nv958 = n950.getTEL1();
                        this.nv959 = n950.getTEL2();
                        this.nv960 = n950.getTEL1();

                        this.nv961 = n950.getMOB1();//mobiphone;
                        this.nv962 = n950.getMOB2();
                        this.nv963 = n950.getMOB3();

                        this.nv964 = n950.getFAX1();
                        this.nv965 = n950.getFAX2();
                        this.nv966 = n950.getFAX3();

                        this.nv967 = n950.getEML1();//emai
                        this.nv968 = n950.getEML2();//sky
                        this.nv969 = n950.getEML3();//yahoo

                        this.nv952 = n950.getStr1();
                        this.nv955 = n950.getDIST();
                        this.nv954 = n950.getWARD();
                        this.nv957 = n950.getCITY();//tinh thanh
                        this.nv960 = n950.getTEL3();//note

                        this.fn100 = n950.getADRID();
                        this.pn950 = n950.getADRNO();
                        this.fn100N = n950.getADRID();
                    }
                }
            }
            return listFindN950;
        } catch (Exception ex) {
            System.out.println(ex);
            return null;
        }

    }

    public int deleteN950(int pn, int id) {
        if (pn != 0 && id != 0) {
            int rows = 0;
            rows = contactStore.deleteEmployee(pn, id, "N100", getLogin().getUserName());
            return rows;
        } else {
            return 0;
        }
    }

    public void changeCountry() {
        try {
            SessionProvider.setSessionMapValue("idCountrySession", this.getFN750());
        } catch (Exception ex) {
            logger.debug("Error when changeCountry(). ERROR CODE: " + ex.getMessage());
        }
    }

    public void changepage(ActionEvent e){
        System.out.println("D:-  changepage is called !");
    }
    /**
     * @return the fn100
     */
    public int getFn100() {
        return fn100;
    }

    /**
     * @param fn100 the fn100 to set
     */
    public void setFn100(int fn100) {
        this.fn100 = fn100;
    }

    /**
     * @return the pn950
     */
    public int getPn950() {
        return pn950;
    }

    /**
     * @param pn950 the pn950 to set
     */
    public void setPn950(int pn950) {
        this.pn950 = pn950;
    }

    /**
     * @return the nv952
     */
    public String getNv952() {
        return nv952;
    }

    /**
     * @param nv952 the nv952 to set
     */
    public void setNv952(String nv952) {
        this.nv952 = nv952;
    }

    /**
     * @return the nv958
     */
    public String getNv958() {
        return nv958;
    }

    /**
     * @param nv958 the nv958 to set
     */
    public void setNv958(String nv958) {
        this.nv958 = nv958;
    }

    /**
     * @return the nv961
     */
    public String getNv961() {
        return nv961;
    }

    /**
     * @param nv961 the nv961 to set
     */
    public void setNv961(String nv961) {
        this.nv961 = nv961;
    }

    /**
     * @return the nv967
     */
    public String getNv967() {
        return nv967;
    }

    /**
     * @param nv967 the nv967 to set
     */
    public void setNv967(String nv967) {
        this.nv967 = nv967;
    }

    /**
     * @return the nv968
     */
    public String getNv968() {
        return nv968;
    }

    /**
     * @param nv968 the nv968 to set
     */
    public void setNv968(String nv968) {
        this.nv968 = nv968;
    }

    /**
     * @return the nv969
     */
    public String getNv969() {
        return nv969;
    }

    /**
     * @param nv969 the nv969 to set
     */
    public void setNv969(String nv969) {
        this.nv969 = nv969;
    }

    /**
     * @return the contactInf
     */
    public ContactInf getContactInf() {
        return contactInf;
    }

    /**
     * @param contactInf the contactInf to set
     */
    public void setContactInf(ContactInf contactInf) {
        this.contactInf = contactInf;
    }

    /**
     * @return the FN750
     */
    public int getFN750() {
        return FN750;
    }

    /**
     * @param FN750 the FN750 to set
     */
    public void setFN750(int FN750) {
        this.FN750 = FN750;
    }

    /**
     * @return the listCountry
     */
    public List<SelectItem> getListCountry() {
        return listCountry;
    }

    /**
     * @param listCountry the listCountry to set
     */
    public void setListCountry(List<SelectItem> listCountry) {
        this.listCountry = listCountry;
    }

    /**
     * @return the nv955
     */
    public String getNv955() {
        return nv955;
    }

    /**
     * @param nv955 the nv955 to set
     */
    public void setNv955(String nv955) {
        this.nv955 = nv955;
    }

    /**
     * @return the nv957
     */
    public String getNv957() {
        return nv957;
    }

    /**
     * @param nv957 the nv957 to set
     */
    public void setNv957(String nv957) {
        this.nv957 = nv957;
    }

    /**
     * @return the nv960
     */
    public String getNv960() {
        return nv960;
    }

    /**
     * @param nv960 the nv960 to set
     */
    public void setNv960(String nv960) {
        this.nv960 = nv960;
    }

    /**
     * @return the nv954
     */
    public String getNv954() {
        return nv954;
    }

    /**
     * @param nv954 the nv954 to set
     */
    public void setNv954(String nv954) {
        this.nv954 = nv954;
    }

    /**
     * @return the fn100N
     */
    public int getFn100N() {
        return fn100N;
    }

    /**
     * @param fn100N the fn100N to set
     */
    public void setFn100N(int fn100N) {
        this.fn100N = fn100N;
    }

    /**
     * @return the temp
     */
    public String getTemp() {
        return temp;
    }

    /**
     * @param temp the temp to set
     */
    public void setTemp(String temp) {
        this.temp = temp;
    }

    /**
     * @return the temp_active
     */
    public String getTemp_active() {
        return temp_active;
    }

    /**
     * @param temp_active the temp_active to set
     */
    public void setTemp_active(String temp_active) {
        this.temp_active = temp_active;
    }

    /**
     * @return the listFind_N950
     */
    public List<N950> getListFind_N950() {
        return listFind_N950;
    }

    /**
     * @param listFind_N950 the listFind_N950 to set
     */
    public void setListFind_N950(List<N950> listFind_N950) {
        this.listFind_N950 = listFind_N950;
    }

    /**
     * @return the flagedit
     */
    public boolean isFlagedit() {
        return flagedit;
    }

    /**
     * @param flagedit the flagedit to set
     */
    public void setFlagedit(boolean flagedit) {
        this.flagedit = flagedit;
    }

    /**
     * @return the pagereload
     */
    public String getPagereload() {
        return pagereload;
    }

    /**
     * @param pagereload the pagereload to set
     */
    public void setPagereload(String pagereload) {
        this.pagereload = pagereload;
    }

    /**
     * @return the nv962
     */
    public String getNv962() {
        return nv962;
    }

    /**
     * @param nv962 the nv962 to set
     */
    public void setNv962(String nv962) {
        this.nv962 = nv962;
    }

    /**
     * @return the table
     */
    public String getTable() {
        return table;
    }

    /**
     * @param table the table to set
     */
    public void setTable(String table) {
        this.table = table;
    }

    /**
     * @return the table1
     */
    public String getTable1() {
        return table1;
    }

    /**
     * @param table1 the table1 to set
     */
    public void setTable1(String table1) {
        this.table1 = table1;
    }

    /**
     * @return the add
     */
    public boolean isAdd() {
        return add;
    }

    /**
     * @param add the add to set
     */
    public void setAdd(boolean add) {
        this.add = add;
    }

    /**
     * @return the edit
     */
    public boolean isEdit() {
        return edit;
    }

    /**
     * @param edit the edit to set
     */
    public void setEdit(boolean edit) {
        this.edit = edit;
    }

    /**
     * @return the delete
     */
    public boolean isDelete() {
        return delete;
    }

    /**
     * @param delete the delete to set
     */
    public void setDelete(boolean delete) {
        this.delete = delete;
    }

    /**
     * @return the messageform
     */
    public String getMessageform() {
        return messageform;
    }

    /**
     * @param messageform the messageform to set
     */
    public void setMessageform(String messageform) {
        this.messageform = messageform;
    }

    /**
     * @return the listAjaxN950Bean
     */
    public List<N950> getListAjaxN950Bean() {
       
        return listAjaxN950Bean;
    }

    /**
     * @param listAjaxN950Bean the listAjaxN950Bean to set
     */
    public void setListAjaxN950Bean(List<N950> listAjaxN950Bean) {
        this.listAjaxN950Bean = listAjaxN950Bean;
    }

    /**
     * @return the render
     */
    public int getRender() {
        return render;
    }

    /**
     * @param render the render to set
     */
    public void setRender(int render) {
        this.render = render;
    }

    /**
     * @return the beginContructor
     */
    public int getBeginContructor() {
        return beginContructor;
    }

    /**
     * @param beginContructor the beginContructor to set
     */
    public void setBeginContructor(int beginContructor) {
        this.beginContructor = beginContructor;
    }

    /**
     * @return the listAjaxK950VBean
     */
    public List<K950V> getListAjaxK950VBean() {
        return listAjaxK950VBean;
    }

    /**
     * @param listAjaxK950VBean the listAjaxK950VBean to set
     */
    public void setListAjaxK950VBean(List<K950V> listAjaxK950VBean) {
        this.listAjaxK950VBean = listAjaxK950VBean;
    }

    /**
     * @return the nv959
     */
    public String getNv959() {
        return nv959;
    }

    /**
     * @param nv959 the nv959 to set
     */
    public void setNv959(String nv959) {
        this.nv959 = nv959;
    }

    /**
     * @return the nv963
     */
    public String getNv963() {
        return nv963;
    }

    /**
     * @param nv963 the nv963 to set
     */
    public void setNv963(String nv963) {
        this.nv963 = nv963;
    }

    /**
     * @return the nv964
     */
    public String getNv964() {
        return nv964;
    }

    /**
     * @param nv964 the nv964 to set
     */
    public void setNv964(String nv964) {
        this.nv964 = nv964;
    }

    /**
     * @return the nv965
     */
    public String getNv965() {
        return nv965;
    }

    /**
     * @param nv965 the nv965 to set
     */
    public void setNv965(String nv965) {
        this.nv965 = nv965;
    }

    /**
     * @return the nv966
     */
    public String getNv966() {
        return nv966;
    }

    /**
     * @param nv966 the nv966 to set
     */
    public void setNv966(String nv966) {
        this.nv966 = nv966;
    }

    /**
     * @return the listpage
     */
    public List<PageContact> getListpage() {
        return listpage;
    }

    /**
     * @param listpage the listpage to set
     */
    public void setListpage(List<PageContact> listpage) {
        this.listpage = listpage;
    }

    /**
     * @return the pc
     */
    public int getPc() {
        return pc;
    }

    /**
     * @param pc the pc to set
     */
    public void setPc(int pc) {
        this.pc = pc;
    }

    /**
     * @return the nv974
     */
    public String getNv974() {
        return nv974;
    }

    /**
     * @param nv974 the nv974 to set
     */
    public void setNv974(String nv974) {
        this.nv974 = nv974;
    }

    /**
     * @return the nv975
     */
    public String getNv975() {
        return nv975;
    }

    /**
     * @param nv975 the nv975 to set
     */
    public void setNv975(String nv975) {
        this.nv975 = nv975;
    }

    /**
     * @return the listoftabN950
     */
    public List<N950> getListoftabN950() {
        try {
            if(SessionProvider.getSessionMapValue("PN100HD")!=null){
                fn100 = Util.parseInt(SessionProvider.getSessionMapValue("PN100HD"));
            }
             System.out.println("----------THAM SO-----N950------"+fn100+","+ 0+","+ getLogin().getUserName());
            listoftabN950 = contactStore.getListContact(fn100, 0, getLogin().getUserName());
              System.out.println("-----SIZE---------"+listoftabN950.size());
        } catch (Exception e) {
        }
        return listoftabN950;
    }

    /**
     * @param listoftabN950 the listoftabN950 to set
     */
    public void setListoftabN950(List<N950> listoftabN950) {
        this.listoftabN950 = listoftabN950;
    }
}
